package com.ray.mode.dtproxyUtil;

import com.ray.mode.dtproxy.Host;
import com.ray.mode.dtproxy.Rent;

public class ProxyMain {

    public static void main(String[] args) {
        //真实对象
        Host host = new Host();

        //动态代理
        ProxyInvocationHandler pih = new ProxyInvocationHandler();
        //设置要代理的对象
        pih.setTarget(host);

        //生成代理对象
        Rent proxy = (Rent) pih.getProxy();

        proxy.rent();
    }

}
